<template>
  <div class="Heading">
    <h1>{{ msg }}</h1>
    <hr />
    <h2>{{ reversedMsg }}</h2>
  </div>
</template>

<script>
export default {
  name: "Heading",
  props: {
    msg: {
      type: String,
      default: "默认的标题",
    },
  },
  setup(props) {
    let reversedMsg = props.msg.split("").reverse().join("");
    return {
      reversedMsg: reversedMsg,
    };
  },
  /*mounted() {
    console.log(this.reversedMsg)
  },
  computed: {
    reversedMsg() {
      return this.msg.split("").reverse().join("")
    }
  }*/
};
</script>

<style scoped></style>
